#ifndef _SPEECH_RECOGNIZE_H_
#define _SPEECH_RECOGNIZE_H_

// #include "esp_err.h"
// #include "audio_event_iface.h"

#ifdef __cplusplus
extern "C" {
#endif
#define ALL_REDAY   BIT0
#define SR_RECORDER_READY BIT1

#include "esp_audio.h"
#include "audio_recorder.h"
#include "freertos/event_groups.h"

extern esp_audio_handle_t     player   ;
extern audio_rec_handle_t     recorder ;

extern QueueHandle_t rec_q;
extern EventGroupHandle_t my_event_group;

enum _rec_msg_id {
    REC_START = 1,
    REC_STOP,
    REC_CANCEL,
};

void voice_read_task(void *args);
esp_audio_handle_t setup_player();
void start_recorder();
void log_clear(void);

esp_err_t periph_callback(audio_event_iface_msg_t *event, void *context);


#ifdef __cplusplus
}
#endif

#endif



